/* -*-c++-*- */
/* osgGIS - GIS Library for OpenSceneGraph
 * Copyright 2007-2008 Glenn Waldron and Pelican Ventures, Inc.
 * http://osggis.org
 *
 * osgGIS is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 */

#ifndef _OSGGIS_COMBINE_LINES_FILTER_H_
#define _OSGGIS_COMBINE_LINES_FILTER_H_ 1

#include <osgGIS/Common>
#include <osgGIS/FeatureFilter>

namespace osgGIS
{
    /**
     * Filter that optimizes line feature collections by combining multiple
     * line features into one.
     *
     * This filter is similar to a "tri-stripper" except that is operates on
     * line data. It will try to optimize a collection of line features by joining
     * their endpoints to produce longer line strips. This can be useful for 
     * optimizing large line layers (e.g., street centerlines).
     *
     * Important note: since this filter combines individual line features into one,
     * you will lose the attributes associated with the input features. If this is
     * a problem, don't use this filter.
     */
    class OSGGIS_EXPORT CombineLinesFilter : public FeatureFilter
    {
        OSGGIS_META_FILTER( CombineLinesFilter );  

    public:
        /**
         * Constructs a new line-stripping filter.
         */
        CombineLinesFilter();

        /**
         * Copy constructor
         */
        CombineLinesFilter( const CombineLinesFilter& rhs );

        ~CombineLinesFilter();

    public: // Filter overrides
        virtual void setProperty( const Property& p );
        virtual Properties getProperties() const;
        
    public: // FeatureFilter overrides
        FeatureList process( FeatureList& input, FilterEnv* env );
    };
}

#endif // _OSGGIS_COMBINE_LINES_FILTER_H_
